package yu.code.yurpc.config;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import yu.code.yurpc.loadbalancer.LoadBalancerKeys;
import yu.code.yurpc.retry.RetryStrategyKeys;
import yu.code.yurpc.serializer.Serializer;
import yu.code.yurpc.serializer.SerializerKeys;
import yu.code.yurpc.tolerant.TolerantStrategyKeys;

/**
 * RPC 框架配置
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class RpcConfig {
    /**
     * 名称
     */
    private String name = "yu-rpc";
    /**
     * 版本号
     */
    private String version = "1.0";
    /**
     * 服务地址
     */
    private String serverHost = "localhost";
    /**
     * 服务端口
     */
    private int serverPort = 8080;
    /**
     * 是否开启mock
     */
    private boolean mock = false;
    /**
     * 序列化器
     */
    private String serializer = SerializerKeys.JDK;
    /**
     * 注册中心配置
     */
    private RegistryConfig registryConfig = new RegistryConfig();
    /**
     * 负载均衡器
     */
    private String loadBalancer = LoadBalancerKeys.ROUND_ROBIN;
    /**
     * 重试策略
     */
    private String retryStrategy = RetryStrategyKeys.NO;
    /**
     * 容错策略
     */
    private String tolerantStrategy = TolerantStrategyKeys.FAIL_FAST;
}
